import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'

import './assets/css/global.css'
Vue.config.productionTip = false


// 导入axios
import axios from 'axios'

//设置请求的根路径
axios.defaults.baseURL = 'http://timemeetyou.com:8889/api/private/v1/'

axios.interceptors.request.use(config => {

  // console.log(config)
  // 为请求头对象，添加token验证的Authorization 字段
  config.headers.Authorization = window.sessionStorage.getItem('token')


  return config;

})

Vue.prototype.$http = axios


new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
